// Copyright (C) joyinter
// All rights reserved.
// 
// Author : Jiang Li
// Date   : 2004-11-9

#ifndef __ROOMCONN_H_CLIENT_MAIN__
#define __ROOMCONN_H_CLIENT_MAIN__

#pragma once

#include "resource.h"
#include <common\ui\wnd.h>
#include <common\ui\button.h>
#include <common\ui\imagectrl.h>
#include <common\ui\label.h>


//##ModelId=44C4B5E000FA
class CJoyRoomConnWnd :
    public CJoyWnd
{
	DECLARE_DYNAMIC(CJoyRoomConnWnd)
public:
	//##ModelId=44C4B5E000FD
    CJoyButton* m_btnCancel;
	//##ModelId=44C4B5E0010C
    CJoyButton* m_btnReConnect;
	//##ModelId=44C4B5E00111
    CJoyImageCtrl*  m_connIcon;
	//##ModelId=44C4B5E0011A
    CJoyLabel*  m_timeCounter;
	//##ModelId=44C4B5E0011E
    DWORD   m_timeCount;
	//##ModelId=44C4B5E0011F
    UINT    m_roomId;

	//##ModelId=44C4B5E00129
    CJoyLabel*  m_mainInfo;
	//##ModelId=44C4B5E0012E
    CJoyLabel*  m_noteInfo;

	//##ModelId=44C4B5E00132
    void ResetValues();
	//##ModelId=44C4B5E00138
    void ResetCounterText();

	//##ModelId=44C4B5E00139
    virtual void CM_Draw(Graphics& graph);
	//##ModelId=44C4B5E0013C
    virtual void CM_CancelClick(CJoyButton*);
	//##ModelId=44C4B5E0014A
    virtual void CM_ReConnectClick(CJoyButton*);
	//##ModelId=44C4B5E0014D
    virtual void CM_LoadSkin(CJoyXmlElement* pSkinElem);
public:
    //CJoyGameSetting*    m_gameSetting;

	//##ModelId=44C4B5E00158
    CJoyRoomConnWnd(void);
	//##ModelId=44C4B5E0015A
    virtual ~CJoyRoomConnWnd(void);

	//##ModelId=44C4B5E00168
    void OnCancel();
public:
    DECLARE_MESSAGE_MAP()
	//##ModelId=44C4B5E00169
    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	//##ModelId=44C4B5E00177
    afx_msg LRESULT OnNcHitTest(CPoint point);
	//##ModelId=44C4B5E0017A
    afx_msg void OnDestroy();
	//##ModelId=44C4B5E00186
    afx_msg void OnTimer(UINT nIDEvent);
};

//##ModelId=44C4B5E00196
class CJoyRoomConnDlg : public CDialog
{
	DECLARE_DYNAMIC(CJoyRoomConnDlg)

protected:
	//##ModelId=44C4B5E001A6
    CJoyRoomConnWnd  m_roomConnWnd;
	//##ModelId=44C4B5E001AA
    bool    m_closeDlg;

public:

	//##ModelId=44C4B5E001AB
	CJoyRoomConnDlg(CWnd* pParent);   // standard constructor
	//##ModelId=44C4B5E001B5
	virtual ~CJoyRoomConnDlg();

	//##ModelId=44C4B5E001B7
	void EndDialog(int nResult)
    {
        m_closeDlg = true;
        __super::EndDialog(nResult);
    }

	//##ModelId=44C4B5E001B9
    virtual void OnCancel();
	//##ModelId=44C4B5E001BB
    virtual void OnOK();

// Dialog Data
	enum { IDD = IDD_JOYSETTINGDLG };

protected:
	//##ModelId=44C4B5E001C6
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()
public:
	//##ModelId=44C4B5E001C9
    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	//##ModelId=44C4B5E001D4
    afx_msg void OnSize(UINT nType, int cx, int cy);
	//##ModelId=44C4B5E001D9
    afx_msg LRESULT OnNcHitTest(CPoint point);
	//##ModelId=44C4B5E001E4
    afx_msg void OnClose();
};


#endif  // __ROOMCONN_H_CLIENT_MAIN__
